﻿using System;
using System.Windows.Forms;
using CodeCrawler.UI.Tools.ViewState;

namespace CodeCrawler.UI.Forms {

    public partial class ViewStateDecoder : Form {
        public ViewStateDecoder() {
            InitializeComponent();
        }

        /// <summary>
        /// Decode ViewState
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e) {

            if (string.IsNullOrEmpty(uiEncodedViewState.Text)) {
                MessageBox.Show("Nothing to decode..", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else {
                var viewStateDecoder = new Decoder();

                uiDecodedViewState.Text = viewStateDecoder.DecodeViewState(uiEncodedViewState.Text);
            }
        }


    }
}